import noPermission from '@/views/error/noPermission.vue'
import useAuthStore from '@/store/auth'
import pinia from '@/store'

const authStore = useAuthStore(pinia)

export default [
  {
    path: '/',
    component: () => import('@/views/error/building.vue'),
    meta: {
      title: '首页',
      icon: 'home',
    },
    show: true,
  },

  {
    path: '',
    meta: {
      title: '招聘',
      icon: 'recruit',
      controls: 'recruit'
    },
    show: true,
    children: [
      {
        path: '/recruit/plans/index',
        component: () => authStore.permission.includes('recruit') ? import('@/views/recruit/plans/index.vue') : noPermission,
        meta: {
          title: '招聘计划',
          icon: 'recruit_plan',
        },
        show: true,
      },
      {
        path: '/recruit/interview/index',
        component: () => authStore.permission.includes('recruit') ? import('@/views/recruit/interview/index.vue') : noPermission,
        meta: {
          title: '我的面试',
          icon: 'mianshi',
        },
        show: true,
      },
      {
        path: '/recruit/formwork/index',
        component: () => authStore.permission.includes('recruit') ? import('@/views/recruit/formwork/index.vue') : noPermission,
        meta: {
          title: '招聘模板',
          icon: 'muban',
        },
        show: true,
      },
      {
        path: '/recruit/talentPool/index',
        component: () => authStore.permission.includes('recruit') ? import('@/views/recruit/talentPool/index.vue') : noPermission,
        meta: {
          title: '人才库',
          icon: 'rencaiku',
        },
        show: true,
      },
      {
        path: '/recruit/talentPool/recordDetails',
        component: () => import('@/views/recruit/talentPool/recordDetails.vue'),
        meta: {
          title: '面试记录',
        },
        show: false,
      },
    ],
  },

  {
    path: '',
    meta: {
      title: '培训',
      icon: 'train',
      controls: 'course'
    },
    show: true,
    children: [
      {
        path: '/course/index',
        component: () => authStore.permission.includes('course') ? import('@/views/course/index.vue') : noPermission,
        meta: {
          title: '课程库',
          icon: 'course',
        },
        show: true,
      },
      {
        path: '/course/details',
        component: () => authStore.permission.includes('course') ? import('@/views/course/details.vue') : noPermission,
        meta: {
          title: '课程详情',
          icon: 'course',
        },
        show: false,
      },
      {
        path: '/course/setup',
        component: () => authStore.permission.includes('course') ? import('@/views/course/setup.vue') : noPermission,
        meta: {
          title: '课程配置',
          icon: 'kechengpeizhi',
        },
        show: true,
      },
      {
        path: '/course/setupDetails',
        component: () => authStore.permission.includes('course') ? import('@/views/course/setupDetails.vue') : noPermission,
        meta: {
          title: '课程配置详情',
          icon: 'course',
        },
        show: false,
      },
      // {
      // 	path: '/train/courses',
      // 	component: () => import('@/views/train/courses/index.vue'),
      // 	meta: {
      // 		title: '课程库',
      // 		icon: 'course',
      // 	},
      // },
      // {
      // 	path: '/train/courses/manager',
      // 	component: () => import('@/views/train/courses/manager.vue'),
      // 	meta: {
      // 		title: '课程维护',
      // 		icon: 'course_manager',
      // 	},
      // },
      {
        path: '/mygroup',
        component: () => import('@/views/group/my_group.vue'),
        meta: {
          title: '学习群组',
          icon: 'users',
        },
      },
      {
        path: '/train/exercise',
        component: () => import('@/views/train/exercise/index.vue'),
        meta: {
          title: '训练',
          icon: 'course_manager',
        },
      },
    ],
  },

  {
    path: '',
    meta: {
      title: '评价',
      icon: 'manager',
      controls: 'evaluate'
    },
    show: true,
    children: [
      {
        path: '/evaluate/plansList',
        component: () => authStore.permission.includes('evaluate') ? import('@/views/evaluate/plansList.vue') : noPermission,
        meta: {
          title: '评价计划',
          icon: 'recruit_plan',
        },
        show: true,
      },
      {
        path: '/evaluate/addPlans',
        component: () => authStore.permission.includes('evaluate') ? import('@/views/evaluate/addPlans.vue') : noPermission,
        meta: {
          title: '创建评价计划',
          icon: 'recruit_plan',
        },
        show: false,
      },
      {
        path: '/evaluate/plansDetails',
        component: () => authStore.permission.includes('evaluate') ? import('@/views/evaluate/plansDetails.vue') : noPermission,
        meta: {
          title: '评价计划详情',
          icon: 'recruit_plan',
        },
        show: false,
      },
      {
        path: '/evaluate/evaluateTemplate',
        component: () => authStore.permission.includes('evaluate') ? import('@/views/evaluate/evaluateTemplate.vue') : noPermission,
        meta: {
          title: '评价计划模板',
          icon: 'recruit_plan',
        },
        show: false,
      },
      {
        path: '/evaluate/index',
        component: () => authStore.permission.includes('evaluate') ? import('@/views/evaluate/index.vue') : noPermission,
        meta: {
          title: '评价',
          icon: 'pingjia',
        },
        show: true,
      },
      {
        path: '/evaluate/form',
        component: () => authStore.permission.includes('evaluate') ? import('@/views/evaluate/form.vue') : noPermission,
        meta: {
          title: '评价模板',
          icon: 'manager',
        },
        show: false,
      },
      // {
      //   path: '/evaluate/myEvaluate',
      //   component: () => authStore.permission.includes('evaluate') ? import('@/views/evaluate/myEvaluate.vue') : noPermission,
      //   meta: {
      //     title: '我的评价',
      //     icon: 'wodepingjia',
      //   },
      //   show: true,
      // },
      {
        path: '/evaluate/myEvaluateDetails',
        component: () => authStore.permission.includes('evaluate') ? import('@/views/evaluate/myEvaluateDetails.vue') : noPermission,
        meta: {
          title: '评价详情',
          icon: 'manager',
        },
        show: false,
      },
    ],
  },

  {
    path: '',
    meta: {
      title: '管理',
      icon: 'guanli',
      controls: 'system'
    },
    show: true,
    children: [
      // {
      // 	path: '/manager/departments',
      // 	component: () =>
      // 		import('@/views/manager/departments/index.vue'),
      // 	meta: {
      // 		title: '部门',
      // 		icon: 'department',
      // 	},
      // },
      // {
      // 	path: '/manager/posts',
      // 	component: () => import('@/views/manager/posts/index.vue'),
      // 	meta: {
      // 		title: '岗位',
      // 		icon: 'post',
      // 	},
      // },
      // {
      // 	path: '/manager/users',
      // 	component: () => import('@/views/manager/users/index.vue'),
      // 	meta: {
      // 		title: '员工',
      // 		icon: 'users',
      // 	},
      // },
      {
        path: '/governance/department',
        component: () => authStore.permission.includes('system') ? import('@/views/governance/department.vue') : noPermission,
        meta: {
          title: '部门管理',
          icon: 'department',
        },
        show: false,
      },
      {
        path: '/governance/position',
        component: () => authStore.permission.includes('system') ? import('@/views/governance/position.vue') : noPermission,
        meta: {
          title: '岗位管理',
          icon: 'post',
        },
        show: false,
      },
      {
        path: '/governance/personnel',
        component: () => authStore.permission.includes('system') ? import('@/views/governance/personnel.vue') : noPermission,
        meta: {
          title: '人员管理',
          icon: 'users',
        },
        show: true,
      },
      {
        path: '/governance/contract',
        component: () => authStore.permission.includes('system') ? import('@/views/governance/contract.vue') : noPermission,
        meta: {
          title: '合同管理',
          icon: 'hetong',
        },
        show: true,
      },
      {
        path: '/governance/base',
        component: () => authStore.permission.includes('system') ? import('@/views/governance/base.vue') : noPermission,
        meta: {
          title: '基础管理',
          icon: 'jichu',
        },
        show: true,
      },
      {
        path: '/governance/reportForms',
        component: () =>
          authStore.permission.includes('system') ? import('@/views/governance/reportForms.vue') : noPermission,
        meta: {
          title: '数据报表',
          icon: 'baobiao',
        },
        show: true,
      },
      {
        path: '/governance/reportFormsCourse',
        component: () =>
          authStore.permission.includes('system') ? import('@/views/governance/reportFormsCourse.vue') : noPermission,
        meta: {
          title: '数据报表课程',
          icon: 'users',
        },
        show: false,
      },
      {
        path: '/governance/reportFormsStaff',
        component: () =>
          authStore.permission.includes('system') ? import('@/views/governance/reportFormsStaff.vue') : noPermission,
        meta: {
          title: '数据报表人员',
          icon: 'users',
        },
        show: false,
      },
    ],
  },
]
    
